作用
从镜像仓库中拉取或更新镜像
语法格式
docker pull [OPTIONS] NAME[:TAG|@DIGEST]
TAG:标签,不写的话默认是 latest 最新版
看看 docker-hub 上的 Tag

options 说明
| option | 作用 |
| -a, --all-tags | 拉取所有 tagged 镜像 |
| --disable-content-trust | 忽略镜像的校验,默认开启 |
| -q, --quiet | 概要输出 |
| --platform string | 若服务支持多平台,这里可以设置平台 |
实际栗子
从 Docker Hub下载java最新版镜像
docker pull java
从 Docker Hub下载 REPOSITORY 为 java 的所有镜像
docker pull -a java
下载镜像的过程
[root@iz2zeak7sgj6i7hrb2g862z ~]# docker pull tomcat:8
8: Pulling from library/tomcat #如果不写tag,默认就是latest
90fe46dd8199: Already exists #分层下载: docker image 的核心 联合文件系统
35a4f1977689: Already exists # Alrea exists 表示本地已存在对应的文件,不需要重复下载,提高速度,减少内存占用率
bbc37f14aded: Already exists
74e27dc593d4: Already exists
93a01fbfad7f: Already exists
1478df405869: Pull complete # 本地没有对应的文件,需要下载,后面再用到该文件的时候就不用再下载了
64f0dd11682b: Pull complete
68ff4e050d11: Pull complete
f576086003cf: Pull complete
3b72593ce10e: Pull complete
Digest: sha256:0c6234e7ec9d10ab32c06423ab829b32e3183ba5bf2620ee66de866df # 签名防伪
Status: Downloaded newer image for tomcat:8
docker.io/library/tomcat:8 # 真实地址
等价写法
docker pull tomcat:8
docker pull docker.io/library/tomcat:8